package com.lrkj.back.service.impl;

import java.util.List;
import java.util.Map;

import com.lrkj.back.entity.ZsShenqing;
import com.lrkj.back.mapper.ZsShenqingMapper;
import com.lrkj.back.service.ZsShenqingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service
public class ZsShenqingServiceImpl extends ParentServiceImpl<ZsShenqing> implements ZsShenqingService {
    @Autowired
    private ZsShenqingMapper shenqingmapper;

    @Override
    protected DBInterface<ZsShenqing> getDao() throws DBException {
        return shenqingmapper;
    }

    @Override
    // ZsDabao这个参数要根据实际 的改
    public PageInfo<ZsShenqing> findAllShenqing(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsShenqing> tbList = shenqingmapper.findAllShenqing(map);
        PageInfo<ZsShenqing> page = new PageInfo<ZsShenqing>(tbList);
        return page;
    }

    @Override
    public List<ZsShenqing> findAllNoPage(Map<String, Object> map) throws DBException {
        return shenqingmapper.findAllShenqing(map);
    }
}
